import AutoImport from 'unplugin-auto-import/vite'

export function AutoImportDeps() {
  return AutoImport({
    imports: [
      'vue',
      'vue-router',
      'pinia',
      '@vueuse/core',
      {
        'naive-ui': ['useDialog', 'useMessage', 'useNotification', 'useLoadingBar'],
        dayjs: [['default', 'dayjs']],
        clsx: [['default', 'clsx']],
        'timeago.js': [
          ['format', 'timeago'],
          ['render', 'timeagoRender']
        ],
        'alova/client': ['useRequest']
      }
    ],

    dts: './types/autoImport/auto-import.d.ts',

    dirs: ['src/components', 'src/store', 'src/types'],

    // fix eslint
    eslintrc: {
      enabled: true,
      filepath: './types/autoImport/.eslintrc-auto-import.json',
      globalsPropValue: true
    }
  })
}
